Plane-based Self-Calibration for Structure from Motion

ABSTRACT

Robust techniques for self-calibration of a moving camera observing a planar scene. Plane-based self-calibration techniques may take as input the homographies between images estimated from point correspondences and provide an estimate of the focal lengths of all the cameras. A plane-based self-calibration technique may be based on the enumeration of the inherently bounded space of the focal lengths. Each sample of the search space defines a plane in the 3D space and in turn produces a tentative Euclidean reconstruction of all the cameras that is then scored. The sample with the best score is chosen and the final focal lengths and camera motions are computed. Variations on this technique handle both constant focal length cases and varying focal length cases.

PRIORITY INFORMATION

This application claims benefit of priority of U.S. ProvisionalApplication Ser. No. 61/525,622 entitled “Plane-based Self-CalibrationTechniques” filed Aug. 19, 2011, the content of which is incorporated byreference herein in its entirety, and to U.S. Provisional ApplicationSer. No. 61/525,621 entitled “Plane-based Structure from Motion” filedAug. 19, 2011, the content of which is incorporated by reference hereinin its entirety.

BACKGROUND Description of the Related Art

In computer vision, inferring three-dimensional (3D) rigid-body motionsof a moving camera from a video or set of images is a problem known asStructure from Motion (SFM). Obtaining a Structure from Motion (SFM)algorithm is of importance because a successful SFM algorithm wouldenable a wide range of applications in different domains including 3Dimage-based modeling and rendering, video stabilization, panoramastitching, video augmentation, vision based robot navigation,human-computer interaction, etc.

A problem in conventional SFM algorithms is in cases where there aremultiple views of a scene with a dominant plane (e.g., a video or set ofimages that include planar or near-planar scenes). Conventional SFMapproaches often assume that the unknown structures to be recovered aregeneral, and hence tend to break down in these degenerative cases ofplanar or near-planar scenes. However, planar or near-planar scenes arecommon, for example in both indoor and outdoor man-made environments, inaerial photos, and in other environments.

SUMMARY

Various embodiments of methods and apparatus for performing structurefrom motion (SFM) are described. Plane-based SFM techniques aredescribed that may be applied, for example, to find thethree-dimensional (3D) structures of a static scene, for example from avideo taken by a moving video camera or from a set of images taken witha still camera. In contrast to conventional SFM techniques, the SFMtechniques described herein are generally based on a single dominantscene plane.

Embodiments of robust techniques for self-calibration of a moving cameraobserving a planar scene are described. These techniques may be referredto as plane-based self-calibration techniques. Embodiments of theplane-based self-calibration techniques may take as input a set ofhomographies between images, for example inter-image homographiesestimated from point correspondences. Each homography represents aprojective transformation from one image to another image. Theplane-based self-calibration techniques provide as output an estimate ofintrinsic parameters (e.g., focal lengths) for all the cameras, and mayalso provide 3D camera motion information (rotation and translation) aswell as plane normal information. Thus, embodiments may take as input aprojective reconstruction (the set of inter-image homographies) for animage sequence and generate as output a Euclidian reconstruction for theimage sequence.

The plane-based self-calibration techniques may be based on theenumeration of the inherently bounded space of the focal lengths. Eachsample of the focal length search space defines a plane in the 3D spaceand in turn produces a tentative Euclidean reconstruction of all thecameras that is then scored. The sample with the best score is chosenand the final focal lengths and camera motions are computed. Variationson this technique are described for handling both constant focal lengthcases and varying focal length cases.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates homography induced by a plane, and introducesthree-dimensional (3D) geometry, terms, and concepts.

FIGS. 2A through 2G graphically illustrate a plane detection andtracking algorithm being applied to a set of four frames according to atleast some embodiments.

FIG. 3 broadly illustrates a plane detection and tracking method thattakes as input a set of point trajectories and outputs a set ofhomographies, according to at least some embodiments.

FIG. 4 is a high-level flowchart of a RANSAC-based plane detection andtracking algorithm, according to at least some embodiments.

FIG. 5A is a flowchart of an alternative plane detection and trackingalgorithm, according to at least some embodiments.

FIG. 5B is a flowchart of a method for estimating a homography for apair of frames, according to at least some embodiments.

FIG. 6 illustrates a plane detection and tracking method that handlesplane transitions, according to at least some embodiments.

FIG. 7 broadly illustrates a plane-based self-calibration method withconstant focal length that takes as input a set of homographies andoutputs structure and camera parameters, according to at least someembodiments.

FIG. 8 broadly illustrates a plane-based self-calibration method withvarying focal length that takes as input a set of homographies andoutputs structure and camera parameters, according to at least someembodiments.

FIG. 9 shows a table of solutions to a planar homography decomposition,according to at least some embodiments.

FIG. 10 is a more detailed flowchart of the self-calibration method withconstant focal length, according to at least some embodiments.

FIG. 11 is a more detailed flowchart of the self-calibration method withvarying focal length, according to at least some embodiments.

FIG. 12 is flowchart of an alternative self-calibration method withvarying focal length, according to at least some embodiments.

FIG. 13 illustrates a plane detection and tracking module, according toat least some embodiments.

FIG. 14 illustrates a plane-based self-calibration module, according toat least some embodiments.

FIG. 15 illustrates an example SFM module that implements embodiments ofa plane detection and tracking method and of a plane-basedself-calibration method.

FIG. 16 illustrates an example computer system that may be used inembodiments.

While the invention is described herein by way of example for severalembodiments and illustrative drawings, those skilled in the art willrecognize that the invention is not limited to the embodiments ordrawings described. It should be understood, that the drawings anddetailed description thereto are not intended to limit the invention tothe particular form disclosed, but on the contrary, the intention is tocover all modifications, equivalents and alternatives falling within thespirit and scope of the present invention. The headings used herein arefor organizational purposes only and are not meant to be used to limitthe scope of the description. As used throughout this application, theword “may” is used in a permissive sense (i.e., meaning having thepotential to), rather than the mandatory sense (i.e., meaning must).Similarly, the words “include”, “including”, and “includes” meanincluding, but not limited to.

DETAILED DESCRIPTION OF EMBODIMENTS

In the following detailed description, numerous specific details are setforth to provide a thorough understanding of claimed subject matter.However, it will be understood by those skilled in the art that claimedsubject matter may be practiced without these specific details. In otherinstances, methods, apparatuses or systems that would be known by one ofordinary skill have not been described in detail so as not to obscureclaimed subject matter.

Some portions of the detailed description which follow are presented interms of algorithms or symbolic representations of operations on binarydigital signals stored within a memory of a specific apparatus orspecial purpose computing device or platform. In the context of thisparticular specification, the term specific apparatus or the likeincludes a general purpose computer once it is programmed to performparticular functions pursuant to instructions from program software.Algorithmic descriptions or symbolic representations are examples oftechniques used by those of ordinary skill in the signal processing orrelated arts to convey the substance of their work to others skilled inthe art. An algorithm is here, and is generally, considered to be aself-consistent sequence of operations or similar signal processingleading to a desired result. In this context, operations or processinginvolve physical manipulation of physical quantities. Typically,although not necessarily, such quantities may take the form ofelectrical or magnetic signals capable of being stored, transferred,combined, compared or otherwise manipulated. It has proven convenient attimes, principally for reasons of common usage, to refer to such signalsas bits, data, values, elements, symbols, characters, terms, numbers,numerals or the like. It should be understood, however, that all ofthese or similar terms are to be associated with appropriate physicalquantities and are merely convenient labels. Unless specifically statedotherwise, as apparent from the following discussion, it is appreciatedthat throughout this specification discussions utilizing terms such as“processing,” “computing,” “calculating,” “determining” or the likerefer to actions or processes of a specific apparatus, such as a specialpurpose computer or a similar special purpose electronic computingdevice. In the context of this specification, therefore, a specialpurpose computer or a similar special purpose electronic computingdevice is capable of manipulating or transforming signals, typicallyrepresented as physical electronic or magnetic quantities withinmemories, registers, or other information storage devices, transmissiondevices, or display devices of the special purpose computer or similarspecial purpose electronic computing device.

Various embodiments of methods and apparatus for performing structurefrom motion (SFM) are described. Embodiments of robust techniques forcomputing 3D camera motion of a moving camera with unknown intrinsicparameters from multiple images of a scene that contains one or moreplanes are described. These SFM techniques may be applied, for example,to find the three-dimensional (3D) structures of a static scene, forexample from a video taken by a moving video camera or from a set ofimages taken with a still camera. In contrast to conventional SFMtechniques, the SFM techniques described herein are based on a singledominant scene plane. The SFM techniques include robust plane detectionand tracking techniques, and efficient plane-based self-calibrationtechniques. The SFM techniques are highly complementary to conventionalgeneral purpose SFM systems. Embodiments of the plane-based SFMalgorithms may detect planar regions across the entire sequence. Theplane-based SFM algorithm works for both constant and varying focallengths. Embodiments of the plane-based SFM algorithm may in additionrecover 3D structure of the non-planar parts of the scene. Embodimentsof the plane-based SFM algorithm may solve the SFM problem usinginformation provided by the dominant plane. Embodiments of theplane-based SFM algorithm may be complimentary to existing generalpurpose SFM methods. Embodiments of the plane-based SFM algorithm mayeasily handle cases that are too challenging for conventional SFMsystems. Embodiments of the plane-based SFM algorithm may provide fast,stable initialization.

Embodiments of robust techniques for detecting and tracking a planeacross multiple images of a scene that contains one or more planes aredescribed. These techniques may be referred to as plane detection andtracking techniques. Embodiments of the plane detection and trackingtechniques may take point trajectories as input and provide as output aset of inter-image homographies. Embodiments of the plane detection andtracking techniques may detect and track planar regions across theentire sequence. The inter-image homographies may, for example, be usedto generate estimates for 3D camera motion, camera intrinsic parameters,and plane normals using a plane-based self-calibration technique asdescribed herein.

Embodiments of robust techniques for self-calibration of a moving cameraobserving a planar scene are also described. These techniques may bereferred to as plane-based self-calibration techniques. Embodiments ofthe plane-based self-calibration techniques may take as input thehomographies between images estimated from point correspondences andprovide an estimate of the focal lengths of all the cameras. Aplane-based self-calibration technique may be based on the enumerationof the inherently bounded space of the focal lengths. Each sample of thesearch space defines a plane in the 3D space and in turn produces atentative Euclidean reconstruction of all the cameras which is thenscored. The sample with the best score may be chosen, and the finalfocal lengths and camera motions are computed. Variations on thistechnique are described for handling both constant focal length casesand varying focal length cases. Algorithms are described that implementvariations of this technique that may be applied to both constant andvarying focal lengths.

While the plane-based SFM techniques are described herein primarily inthe context of performing the techniques on sequences of frames invideos, note that the techniques may also be applied to any sets ofimages on which SFM may need to be performed, for example sequences ofimages shot with a digital camera and/or sequences of images shot with aconventional film camera and later digitized. Also note that, whileembodiments are describe specifically for processing video or imagesequences in which there is a dominant 2D plane, embodiments may beapplied to sequences that do not specifically include an obviousdominant 2D plane, e.g. a set of images that include a cluttereddesktop. In such cases, an approximation of a 2D plane may be derivedfrom the point trajectories and used to generate an initial motion. The2D plane assumption may then be relaxed to generate a final, refinedresult.

Robust Plane Detection and Tracking Techniques

Embodiments of plane-based SFM techniques are described that may addressthe problem of structure from motion (SFM) from multiple views of ascene where a dominant plane is present. Conventional SFM approachesoften assume that the unknown structures to be recovered are general,and hence may break down in this degenerative case. Unfortunately, theplanar scene case is a situation that is hard to avoid in many video andphotography environments, including but not limited to indoor andoutdoor man-made environments, aerial photos, and others. Embodiments ofthe plane-based SFM algorithms may provide methods for reconstructingplanar or near-planar scenes by robustly detecting and tracking planesand directly analyzing their geometry. Furthermore, embodiments of theplane-based SFM algorithms may be applied to enhance the performance ofexisting SFM systems.

SFM aims to find the 3D structures of a static scene, for example from avideo taken by a camera moving around it. For example, a photographermay take a lot of pictures while walking on the Great Wall of China, orin some other similar environment. Later, the photographer may want toreconstruct the 3D scene as well as determine where the images aretaken, potentially without knowing anything about the camera such as itsfocal length. In cases like this, the photographer needs a solution tothe SFM problem.

To reconstruct the 3D from the images, a method first needs to connectall the images together. This can be done, for example, by detecting,matching and tracking feature points over the entire sequence, such ascorner features or SIFT features. Each detected feature now correspondsto a point trajectory over time. Note that the point trajectories mayappear or disappear at any time and usually only span a subsequence ofthe entire video or image sequence. These trajectories serve as theinput to most conventional SFM systems, and are also used as input toembodiments of the plane-based SFM techniques described herein.

Conventional SFM methods, as noted above, start with a set of featurepoints and/or trajectories, for example using SIFT features. Then, twoor three frames are carefully selected to initialize the structure andmotion recovery. This leads to the first projective reconstruction.Then, additional views are added into the reconstruction in anincremental fashion. For example, at each iteration, a view with thelargest number of matches with the current view may be found. At somepoint, camera calibration may be performed. By that time, the rotationand translation of each camera (i.e., each image) may be recovered withregard to some world coordinate system. While this procedure is quitegeneral, assumptions are made for it to work well. In particular, theconventional SFM techniques assume a general structure. However, aspreviously noted, these conventional techniques may fail in at leastsome cases, for example when images are dominated by planar ornear-planar structure. Since these conventional methods generally dependon feature trajectories that are based on feature points of 3D objects,they tend to not do well or fail completely in such cases, as there maynot be enough 3D information in the image(s) to provide the necessaryfeature points for generating point trajectories.

Problem Formulation

FIG. 1 illustrates homography induced by a plane, and introducesthree-dimensional (3D) geometry, terms, and concepts used to formulatethe problem. Consider two images of a point P on a plane PI (Π) in the3D space. Assume the world coordinate system is associated with the leftcamera, and the plane equation can be written as show, where n is a 3*1unit normal vector and d is the distance from the plane to the origin.Now, suppose the left and right frames are related by a 3*3 rotationmatrix R and a 3*1 translation vector t; then the coordinatetransformation between the two frames can be written as:

${n^{T}X} = { d\Rightarrow{\frac{1}{d}n^{T}X}  = 1}$$X^{\prime} = {{{RX} + t} = {{{RX} + {t\; \frac{1}{d}n^{T}X}} = {( {R + {\frac{1}{d}{tn}^{T}}} )X}}}$

P is projected to x and x′ in the first and second images, respectively.The map from x to x′ is the homography induced by the plane PI (Π):

$\mspace{79mu} {{x \cong {KX}},{ {x^{\prime} \cong {K^{\prime}X^{\prime}}}\mspace{79mu}\Rightarrow{x^{\prime} \cong {{K^{\prime}( {R + {\frac{1}{d}{tn}^{T}}} )}K^{- 1}x}}  = {{{Hx} \cong}:\; {{equality}\mspace{11mu} {up}\mspace{11mu} {to}\mspace{11mu} {scale}}}}}$

The point correspondence between two images can be modeled as ahomography. A homography thus represents the projective transformationfrom one image to another image. A homography H may be represented as a3*3 matrix. Note that H can only be recovered up to some scale, and mayhave eight (8) degrees of freedom in total. Each two-dimensional (2D)point correspondence imposes two constraints on H via the equationx′=Hx, and it can be inferred that four such 2D-to-2D correspondencesfrom points on the plane (x_(i)

x′_(i), i=1, 2, 3, 4) are sufficient to determine the homography up toscale.

Suppose that a planar scene is viewed by N cameras. K_(i)ε□^(3×3) may beused to denote the intrinsic matrix of the i-th camera. Without loss ofgenerality, the world coordinate frame may be chosen to be the cameraframe of the first camera, and R_(i)εSO(3) and t_(i)ε□³ may be used todenote the Euclidean transformation from the world coordinate frame tothe i-th camera frame. Note that [R₁, t₁]=[I, 0] by definition.

For the scene structure, it may be assumed that the world plane π hascoordinates π=(n, d)T with respect to the world coordinate frame, wheren^(T) is the unit normal vector and d>0 denotes the distance from theplane to the world origin. Therefore, for any point Xε□³ on the plane,n^(T)X=d.

Consider a situation in which a set of trajectories

T={T _(j)}_(j=1) ^(M)

of M feature points on π are observed. For each T_(j), let p_(j) andq_(j) (1≦p_(j)≦q_(j)≦N) denote the starting and ending frames,respectively. The following can be formulated:

T _(j) ={x _(j) ^(i)}_(i=p) _(j) ^(q) ^(j) ,

where x_(j) ^(i)εP² are the homogeneous coordinates of the j-th point asseen by the i-th camera. The coordinates of the first frame and the i-thframe are related by a planar homography x_(j) ^(i)=H_(i)x_(i) ¹ whereH_(i) can be written as:

H _(i) □K _(i)(R _(i) +t _(i) n ^(T) /d)K₁ ⁻¹,  (A1)

with the symbol ␣ indicating “equality up to a scale.”

Since the translation parameters can only be recovered up to someunknown scale factor {tilde over (t)}=t_(i)/d, a goal of the plane-basedSFM algorithm can be stated as finding all the unknown camera parameters{K_(i),R_(i),{tilde over (t)}_(i)}_(i=1) ^(N), the plane normal n andthe scene points, given the 2D trajectories {T_(j)}_(j=1) ^(M) on theimages.

Robust Plane Detection and Tracking Method

If all the tracked points belong to the same scene plane, the epipolargeometry (fundamental matrix) cannot be uniquely determined; thus, mostconventional SFM methods would fail on such sequences. Embodiments of aplane-based SFM method as described herein may provide a complete systemfor uncalibrated SFM that can handle planar or near-planar scenes.

A key idea is that if the inter-plane homographies {H_(i)}_(i=1) ^(N)(also referred to herein as inter-image homographies, or justhomographies) can be reliably estimated, then both camera parameters andscene structures can be accurately computed using a plane-basedself-calibration method, for example as described in the section titledRobust plane-based self-calibration techniques. However, estimating thehomographies from those trajectories is not a straightforward task.First, some of the trajectories may come from an outlying object off theplane, such as a person walking on the ground. In certain frames, thenumber of outlying trajectories may even be much larger than the numberof inliers. Second, plane transition (change of dominant plane) mayoccur at any time over the sequence.

A RANSAC-based algorithm for robust reconstruction when a singledominant plane covers the entire sequence is described. In addition, itis shown how this method can be extended to handle plane transitions.

RANSAC is an abbreviation for “RANdom SAmple Consensus”. RANSAC is aniterative method to estimate parameters of a mathematical model from aset of observed data that contains outliers. The RANSAC algorithm is anon-deterministic algorithm in the sense that it produces a reasonableresult only with a certain probability, with this probability increasingas more iterations are allowed. A basic assumption is that the dataconsists of “inliers”, i.e., data whose distribution can be explained bysome set of model parameters, and “outliers” which are data that do notfit the model. In addition to this, the data can be subject to noise.The outliers can come, for example, from extreme values of the noise orfrom erroneous measurements or incorrect hypotheses about theinterpretation of data. The RANSAC algorithm also assumes that, given a(usually small) set of inliers, there exists a procedure that canestimate the parameters of a model that optimally explains or fits thisdata.

FIG. 3 broadly illustrates a general plane detection and tracking methodthat takes as input a set of point trajectories and outputs a set ofinter-image homographies, according to at least some embodiments. Asindicated at 300, a set of point trajectories for a set of images (e.g.,a video sequence, or a set of still photographs) may be obtained. Asindicated at 302, a 2D plane in the images is detected from the pointtrajectories. As indicated at 304, trajectories that follow the 2D planethrough the images may be identified. As indicated at 306, theidentified trajectories may be used to compute a set of inter-imagehomographies for the images. Note that the output homographies may, butdo not necessarily, cover the entire set of images.

The general method of FIG. 3 and variations thereof are described inmore detail below.

RANSAC-Based Plane Detection and Tracking

Given N frames of a scene {F_(i)}_(i=1) ^(N), letT^(ab)={T_(j)εT:p_(j)≦a, q_(j)≧b} be the set of trajectories which spanthe a-th and b-th frames. N−1 pairs of adjacent frames are formed:C={(F1, F2), (F2, F3), . . . , (F_(N-1), F_(N))}. A straightforwardtechnique for plane detection is to estimate the homography between eachpair separately, where a RANSAC-based algorithm is used to handleoutliers. This algorithm is described below as algorithm 1. Note thatthis algorithm is not intended to be limiting.

Algorithm 1 (Plane Detection Via Two-Frame Homography Estimation)

-   01: Input: A set of M trajectories T over N frames. A RANSAC    distance threshold E.-   02: for 2≦i≦N-   03: repeat for n trials: (RANSAC robust estimation of H_((i-1)i))-   04: Select a random sample of four (4) point correspondences between    the pair (F_((i-1)), F_(i)) and compute the homography H_((i-1)i).-   05: For each T_(j)εT^((i-1)i), compute the distance    dist_(j)=dist(x_(j) ^(i),H_((i-1)i)x_(j) ^((i-1))).-   06: Compute the number of inliers consistent with H_((i-1)i) by the    number of trajectories for which dist_(j)≦E.-   07: end repeat-   08: Choose the H_((i-1)i) with the largest number of inliers.-   09: end for-   10: Compute the homography between the first and the i-th frame    recursively using {H_((i-1)i)}_(i=2) ^(N):

H ₁ =I _(3×3) , H _(i) =H _((i-1)i) H _((i-1)) , i=2, . . . , N.

-   11: Output: A set of inter-image homographies {H_(i)}_(i=1) ^(N).

A drawback of such a method is that it may fail on image pairs in whichthe percentage of outliers is high (e.g., >50%), due to the fact thatall point correspondences between the image pair are used for RANSACsampling. To overcome this difficulty, a RANSAC-based plane detectionand tracking algorithm is described that can detect the plane even inthe frames in which the outliers dominate. FIG. 4 is a high-levelflowchart of this algorithm.

As indicated at 400, a pair of frames is selected from an imagesequence. The inter-image homography is estimated for the pair ofimages, as indicated at 402. In at least some embodiments, the algorithmstarts with any pair in C and estimates the inter-image homography usinga RANSAC-based algorithm. As indicated at 404, the algorithm theniteratively propagates the detected plane from the current frame pair toits neighbors in C, where two pairs are neighbors if they share a commonframe. The inter-image homography is estimated at each pair according tothe RANSAC-based algorithm. In at least some embodiments, except for thefirst pair of frames, only the inlying trajectories (also referred toherein as inliers) propagated from the previously processed frames areused as candidates for RANSAC sampling and for estimating thehomography, which may result in a more robust algorithm to outliers(outlying trajectories) than algorithm 1.

As indicated at 406 of FIG. 4, in at least some embodiments, thehomographies may be refined. In at least some embodiments, once theestimates of {H_(i)}_(i=1) ^(N) and the set of inliers T_(in) areobtained, the homographies may be refined using a nonlinear programtechnique which minimizes the geometric errors for all trajectories inT_(in):

$\begin{matrix}{{\min\limits_{x_{j},H_{i}}{\sum\limits_{j:{T_{j} \in T_{in}}}{\sum\limits_{i = p_{j}}^{q_{j}}{{dist}( {x_{j}^{i},{H_{i}x_{j}}} )}^{2}}}},} & ({A2})\end{matrix}$

where dist(x_(j) ^(i),H_(i)x_(j)) is defined as the Euclidean imagedistance in the i-th image between the measurement point x_(j) ^(i) andthe point H_(i)x_(j) at which the corresponding point x_(j) is mappedfrom the first image. Note that x_(j) is used as the variable inequation (A2) in order to differentiate it from x_(j) ¹, whichrepresents the measured 2D feature point coordinates in the first frame.

Details of this RANSAC-based plane detection and tracking algorithm aregiven in algorithm 2, which is not intended to be limiting. Note thatthe order of steps 3 and 4 may be switched by first selecting a randomsample of four (4) trajectories and then selecting a frame pair that isshared by all the trajectories. However, in practice it may be moreefficient to first sample the frame pairs, as many trajectories do notshare any frame.

Algorithm 2 (RANSAC-Based Plane Detection and Tracking Algorithm)

-   01: Input: A set of M trajectories T over N frames. A RANSAC    distance threshold E.-   02: repeat for n trials: (RANSAC robust plane detection)-   03: Select a random pair of frames (F_(i-1), F_(i)) from C. Set    C_(p)={(F_(i-1), F_(i))}.-   04: Select a random sample of four (4) trajectories from T^((i-1)i)    and compute the homography H_((i-1)i).-   05: For each T_(j)εT^((i-1)i), compute the distance    dist_(j)=dist(x_(j) ^(i),H_((i-1)i)x_(j) ^(i-1)).-   06: Partition T^((i-1)i) into inliers and outliers:

T _(in) ={T _(j) εT ^((i-1)i):dist_(j) ≦E}, T _(out) ={T _(j) εT^((i-1)i):dist_(j) >E}.

-   07: while C_(p)≠C-   08: Select a pair of frames (F_((i-1)), F_(i)) from C\C_(p) such    that one of its neighbors is in C_(p). Set C_(p)=C_(p)∪{(F_((i-1)),    F_(i))}.-   09: Set T_(c) ^((i-1)i)=T_(in)∩T^((i-1)i).-   10: if |T_(c) ^((i-1)i)|<4; break; end if-   11: repeat for n trials: (RANSAC robust estimation of H_((i-1)i))-   12: Select a random sample of four (4) trajectories from T_(c)    ^((i-1)i) and compute the homography H_((i-1)i).-   13: For each T_(j)εT^((i-1)i)\T_(out), compute the distance

dist_(j)=dist(x _(j) ^(i) ,H _((i-1)i) x _(j) ^((i-1))).

-   14: Compute the number of inliers consistent with by the number of    trajectories for which dist_(j)≦E.-   15: end repeat-   16: Choose the with the largest number of inliers.-   17: Partition all unclassified trajectories in T into inliers and    outliers:

T _(in) =T _(in) ∪{T _(j) εT ^((i-1)i)\(T _(out) ∪T _(in)), dist_(j)≦E},

T _(out) =T _(out) ∪{T _(j) εT ^((i-1)i)\(T _(out) ∪T _(in)), dist_(j)>E}.

-   18: end while-   19: end repeat-   20: Choose the set of {H_((i-1)i)}_(i=2) ^(N) from the trial with    the largest number of inliers |T_(in)|.-   21: Compute the homography between the first and the i-th frame    recursively using {H_((i-1)i)}_(i=2) ^(N):

H ₁ =I _(3×3) ,H _(i) =H _((i-1)i) H _(i-1) , i=2, . . . , N.

-   22: Optimal estimation: re-estimate {H_(i)}_(i=1) ^(N) from all    trajectories classified as inliers, by minimizing equation (A2), for    example using the Levenberg-Marquardt algorithm.-   23: Output: A set of inter-image homographies {H_(i)}_(i=1) ^(N).

FIG. 5A is a flowchart of an alternative formulation for theRANSAC-based plane detection and tracking algorithm, according to atleast some embodiments. This algorithm, like algorithm 2, estimates aninter-image homography for a first pair of frames in an image sequence,initializes the projective reconstruction for the image sequence withthe homography for the first pair of frames, and then propagates thereconstruction to the remaining frames. However, this algorithm, afteradding the homography and inlier trajectories for each subsequent frameto the projective reconstruction, performs a global optimization of theprojective reconstruction, and then identifies and removes outliertrajectories from the projective reconstruction and identifies and addsinlier trajectories to the projective reconstruction. In at least someembodiments, if more than a threshold number of inliers are added, asecond global optimization is performed. Elements 500 and 502 representthe initial pair reconstruction, and elements 504 through 520 representan iterative process that propagates the reconstruction across the restof the frames in the image sequence.

As indicated at 500 of FIG. 5A, an inter-image homography is estimatedfor an initial pair of frames selected from an image sequence, andinlier trajectories that are consistent with the homography aredetermined. FIG. 5B illustrates a method for estimating a homography fora pair of frames that may be used at element 500, in at least someembodiments. As indicated at 502, the estimated inter-image homographyand trajectories may be optimized, for example according to a non-linearoptimization technique, and the optimized homography and trajectoriesmay be added to the projective reconstruction.

Elements 504 through 520 of FIG. 5A iteratively add frames that are notin the current reconstruction to the reconstruction. As indicated at504, a next frame not in the current reconstruction is selected, and aclosest frame to the selected frame that is already in the currentreconstruction is found. As indicated at 506, an inter-image homographyis computed for the pair of frames. In at least some embodiments, amethod similar to the method illustrated in FIG. 5B may be used tocompute the inter-image homography.

As indicated at 508 of FIG. 5A, the inter-image homography may beoptimized, for example according to a non-linear optimization technique,and the optimized homography may be added to the current reconstruction.In at least some embodiments, the optimized homography may be added tothe reconstruction by composing the optimized homography against ahomography of the previously determined closest frame. In at least someembodiments, the homography of the closest frame against which theoptimized homography is composed may be a homography with respect to aglobal reference frame. In at least some embodiments, the globalreference frame may be one of the initial pair of frames from elements500-502. In at least some embodiments, composing may be performed as amultiplication of the homographies: dH*H, where dH is the optimizedhomography between the current frame being processed and the closestframe and H is the homography between the closest frame and the globalreference frame.

As indicated at 510 of FIG. 5A, inliers consistent with the optimizedhomography may be determined and added to the reconstruction. Asindicated at 512, a global optimization may be performed on thereconstruction. The global optimization may involve jointly optimizingthe homographies for all the frames and all of the trajectories.

As indicated at 514 of FIG. 5A, outlier trajectories may be identifiedand removed from the reconstruction. In at least some embodiments, theoutlier trajectories to be removed may be identified as all trajectoriesfor which the fitting error at a frame in the reconstruction is greaterthan a threshold.

As indicated at 516 of FIG. 5A, inlier trajectories may be identifiedand added to the reconstruction. In at least some embodiments, theinlier trajectories that are added may be identified by processing allof the trajectories that are not in the current reconstruction. Each ofthe trajectories not in the current reconstruction is reconstructed, anda fitting error is computed for the reconstructed trajectory in all theframes in the current reconstruction. Any of these frames for which thefitting error is below a threshold in all of the frames in the currentreconstruction is determined to be an inlier trajectory, and is added tothe current reconstruction.

As indicated at 518 of FIG. 5A, if the number of inliers added to thecurrent reconstruction is above a threshold, then another globaloptimization may be performed on the current reconstruction.

At 520 of FIG. 5A, if there are more frames not in the currentreconstruction, then the method returns to element 504 to get andprocess a next frame. Otherwise, the set of inter-image homographies,representing the projective reconstruction for the image sequence, isoutput, as indicated at 522.

FIG. 5B is a flowchart of a method for estimating a homography for apair of frames, according to at least some embodiments. The methodperforms several trials to compute inter-image homographies for twoinput frames according to different sets of trajectories between theframes, scores each homography (e.g., by computing the number of inliertrajectories consistent with the homography), and then when the trialsare done selects a homography with the best score (e.g., the homographywith the most inliers). As indicated at 550, the method selects a randomsample of four trajectories between the frames. As indicated at 552, aninter-image homography is computed according to the selectedtrajectories. As indicated at 554, a fitting error is computed for alltrajectories between the frames according to the homography. Asindicated at 556, the number of inliers consistent with the homographyis computed. At 558, if more trials are to be performed, the methodreturns to 550. Otherwise, as indicated at 560, a homography with themost inliers is selected as the estimated homography for the pair offrames, and the estimated inter-image homography and inlier trajectoriesare output.

FIGS. 2A through 2G graphically illustrate a plane detection andtracking algorithm being applied to a set of four frames, according toat least some embodiments. In FIG. 2A, the method starts with a set offeature point trajectories over multiple frames. The dots representinlying trajectories according to ground truth, that is, points trackedon the ground (the dominant plane). The X's represent outliers accordingto ground truth, e.g. points tracked on trees, moving persons, or other3D objects. In FIG. 2B, a random sample of four (4) trajectories isselected between the first and second frames and the inter-framehomography is computed, for example using a RANSAC technique. In FIG.2C, all the trajectories between the first and second frames arepartitioned into inliers and outliers by checking whether thetrajectories are consistent with the inter-frame homography for thefirst and second frames. In FIG. 2D, a random sample of four (4)trajectories is selected between the second and third frames from thetrajectories previously classified as inliers, and the inter-framehomography is computed. In FIG. 2E, all unclassified trajectoriesbetween the second and third frames are partitioned into the sets ofinliers and outliers by checking whether the trajectories are consistentwith the inter-frame homography for the second and third frames. In FIG.2F, a random sample of four (4) trajectories is selected between thethird and fourth frames from the trajectories previously classified asinliers, and the inter-frame homography is computed. In FIG. 2G, allunclassified trajectories between the third and fourth frames arepartitioned into inliers and outliers by checking whether thetrajectories are consistent with the inter-frame homography for thethird and fourth frames. In this example the total number oftrajectories classified as inliers over all the frames is 10. The methodmay continue to process additional pairs of frames until all pairs havebeen processed or until the plane disappears (i.e., until the number ofinliers falls below a threshold). When no more pairs of frames are to beprocessed or there are not enough inlier trajectories, the algorithm(algorithm 1) may then be completed to output a set of inter-frame (alsoreferred to as inter-image) homographies for the image sequence.

While both algorithms 1 and 2 include specific examples of values forsome parameters (e.g., four random trajectory samples), note that thesevalues may be different in some embodiments. Also note that variousembodiments may implement either algorithm 1 or algorithm 2, or bothalgorithms 1 and 2, or variations thereof.

Handling Plane Transitions

In many real scenarios, the dominant plane may change over time. Forexample, in urban environments, the dominant plane may change from onebuilding facade to another facade, or to the ground; in indoor scenes,the dominant plane may change from the wall to the ceiling, from onewall to another wall, and so on. Under such circumstances, algorithm 2may simply stop when the first dominant plane is no longer visible,resulting in an incomplete reconstruction.

A technique to handle plane transitions that may be used in at leastsome embodiments of the plane detection and tracking method is tore-instantiate the model at the appropriate frame, that is, the framewhere the second plane becomes visible. An algorithm that may be used insome embodiments to accomplish this is described below. Note that thisalgorithm incorporates algorithm 2.

Algorithm for Handling Plane Transitions

-   1. Set k₁=1, l=1.-   2. Starting from the k₁-th frame, run algorithm 2. Suppose the    algorithm stops at the k₂-th frame. A set of homographies    H_(l)={H_(i) ^(l)}_(i=k) ₁ ^(k) ² and a set of inlying trajectories    T_(in) ^(l) are obtained.-   3. If k₁<k₂<N, set T_(c) ^(k) ² ^((k) ² ⁺¹⁾=T^(k) ² ^((k) ²    ⁺¹\T_(in) ^(l), k₁=k₂, l=l+1, and go to step 2. Otherwise, stop.

Note that in step 3 of the algorithm for handling plane transitions, theset of candidate trajectories for the next run are assigned to be thetrajectories that are not classified as inliers in the current run. Thismay help to avoid repeatedly detecting the same plane. The algorithmterminates if no more planes are detected.

An assumption may be made that when transition occurs, both planes arevisible in at least two adjacent frames. This may allow the method toobtain a complete reconstruction of the entire sequence by comparing andconcatenating the camera motion parameters computed from differentplanes. More precisely, suppose the method has recovered a set of cameramotion parameters {R_(p) ¹,{tilde over (t)}_(p) ¹}_(p=1) ^(P) from H₁associated with the first plane, and another set of camera motionparameters {R_(q) ²,{tilde over (t)}_(q) ²}_(q=1) ^(Q) have beenrecovered from H₂ associated with the second plane. Since the two setsof parameters use different world coordinate systems, they need to bealigned to get the complete reconstruction result. In the case where thelast two frames of the first plane coincide with the first two frames ofthe second plane, the relative scale s between the two coordinatesystems can be computed as:

$\begin{matrix}{s = \frac{{- {R_{2}^{2}( {{( {- R_{P}^{1}} )^{T}{\overset{\sim}{t}}_{P}^{1}} - {( {- R_{P - 1}^{1}} )^{T}{\overset{\sim}{t}}_{P - 1}^{1}}} )}}}{{\overset{\sim}{t}}_{2}^{2}}} & ({A3})\end{matrix}$

In at least some embodiments, the second set of camera motion parameterswith respect to the coordinate system associated with the first planemay be computed as:

(R _(q) ²)′=R _(q) ² R _(P-1) ¹, ({tilde over (t)} _(q) ²)′=R _(q) ²{tilde over (t)} _(P-1) ¹ +s{tilde over (t)} _(q) ² , q=1, . . . ,Q.  (A4)

In addition, at least some embodiments may implement one or morerelatively simple heuristics to detect the disappearance of a dominantplane over time and stop the algorithm at the appropriate frame (seestep 2 of the algorithm for handling plane transitions). This may beimportant because in cases where the plane only covers a small part ofthe images, the homography estimated from it may not be reliable.

A first heuristic that may be used in at least some embodiments isrelated to the area A of the convex hull of the four points that arechosen to estimate the homography. In at lest some embodiments, thealgorithm stops if A is too small, for example if A≦ 1/16×imagewidth×image height.

A second heuristic that may be used in at least some embodiments isrelated to the 9×9 covariance matrix C of the estimated homography H. Alarge entry in C typically indicates some degenerated configuration ofthe four images points (e.g., three points lie roughly on a line).Therefore, in at least some embodiments, the algorithm may stop if thelargest entry in C exceeds a specified threshold.

FIG. 6 is a flowchart of a plane detection and tracking method thathandles plane transitions as described above, according to at least someembodiments. As indicated at 600, a candidate set of point trajectoriesfor a set of images (e.g., a video sequence, or a set of stillphotographs) may be obtained. Starting at a current image, the methodattempts to detect a plane (e.g., a dominant plane) from the candidateset of point trajectories, as indicated at 602. At 604, if a plane isdetected, then at 606 the method may identify trajectories that followthe plane through two or more of the images and compute inter-imagehomographies until a stop condition (e.g., disappearance of the planeand/or the appearance of a new dominant plane) is reached. At 608, ifthere are more images, then the method returns to 602 to attempt toidentify a new (dominant) plane. In at least some embodiments, asindicated at 610, identified inlier trajectories may be excluded fromthe candidate set of trajectories when attempting to identify a newplane at 602 so that the method can avoid repeatedly detecting the sameplane.

If a plane is not detected at 604 or if there are no more images toprocess at 610, then at 612, if two or more sets of inter-imagehomographies have been generated by repeating elements 602 and 606 fordifferent planes in different segments of the image sequence, then thetwo or more sets of inter-image homographies may be concatenated into asingle continuous set, as indicated at 614. The homographies are outputat 616. Note that the output homographies may, but do not necessarily,cover the entire set of images.

The Plane Detection and Tracking Algorithm and Plane-BasedSelf-Calibration

Given the set of homographies H={H_(i)}_(i=1) ^(N), it is possible toself-calibrate cameras using a method as described in the section titledRobust plane-based self-calibration techniques, and to obtain an initialsolution to all the camera and structure parameters. For the sequenceswith plane transition, each set of homographies H_(l) may be decomposedinto camera and structure parameters as described in the section titledRobust plane-based self-calibration techniques, and then each set ofhomographies H_(l) may be concatenated by transferring all theparameters to the same world coordinate system.

Optimal Camera Motion and Scene Structure Recovery

In at least some embodiments, with an initial solution to all theparameters and the set of inlying trajectories T_(in), the estimates maybe refined using a non-linear program. For the single dominant planecase, to find the best camera parameters K_(i),R_(i),{tilde over(t)}_(i) and the unit plane normal n, the following geometric errors maybe minimized over all inlying trajectories:

$\begin{matrix}{{\min\limits_{x_{j},K_{i},R_{i},{\overset{\sim}{t}}_{i},n}{\sum\limits_{j:{T_{j} \in T_{in}}}{\sum\limits_{i = p_{j}}^{q_{j}}{{dist}( {x_{j}^{i},{{K_{i}( {R_{i} + {{\overset{\sim}{t}}_{i}n^{T}}} )}K_{1}^{- 1}x_{j}}} )}^{2}}}},} & ({A5})\end{matrix}$

which can be solved, for example, via the Levenberg-Marquardt (LM)method.

Similarly, for the multiple dominant plane cases, the following costfunction may be minimized:

$\begin{matrix}{\min\limits_{x_{j},K_{i},R_{i},{\overset{\sim}{t}}_{i},n_{l}}{\sum\limits_{l = 1}^{L}{\sum\limits_{j:{T_{j} \in T_{in}^{l}}}{\sum\limits_{i = p_{j}}^{q_{j}}{{{dist}( {x_{j}^{i},{{K_{i}( {R_{i} + {{\overset{\sim}{t}}_{i}n_{l}^{T}}} )}K_{1}^{- 1}x_{j}}} )}^{2}.}}}}} & ({A6})\end{matrix}$

Reconstruction of 3D Structures

With the known camera parameters and the plane normal, all the points onthe plane may be back-projected to their 3D positions. The positions ofthe off-the-plane points in the 3D space can also be triangulated. In atleast some embodiments, to get the optimal estimates, a non-linearprogram technique may be used to minimize the geometric errors but nolonger enforce the planar surface constraint. For example, the followingmay be used in at least some embodiments:

$\begin{matrix}{{\min\limits_{X_{j},K_{i},R_{i},{\overset{\sim}{t}}_{i}}{\sum\limits_{j}{\sum\limits_{i = p_{j}}^{q_{j}}{{dist}( {x_{j}^{i},{K_{i}( {{R_{i}X_{j}} + t_{i}} )}} )}^{2}}}},} & ({A7})\end{matrix}$

where X_(j) is the 3D position of the j-th feature point.

Robust Plane-Based Self-Calibration Techniques

Embodiments of a method for self-calibrating a projective camera withgeneral, unknown motion from multiple views of a scene where a dominantplane is present are described. This method may be referred to as aplane-based self-calibration technique or algorithm. While conventionalmethods have provided the ability to solve the self-calibration problemin different settings, these conventional methods often assume theunknown scene structures are general in 3D, and hence break down in thedegenerative cases of planar or near-planar scenes. Embodiments of amethod for self-calibration are described that, in contrast toconventional methods, can handle such cases by directly using theinter-frame homographies induced by the plane.

Self-calibration is an important component in any Structure from Motionsystem of cameras with unknown intrinsic parameters. Withoutself-calibration, only a projective reconstruction can be obtained.Embodiments of the plane-based self-calibration technique may generate aEuclidean reconstruction by estimating camera intrinsic parameters(e.g., focal length), and in addition may solve the entire Euclideanmotion estimation problem by providing estimates for camera rotationsand translations and the plane normal based on an input set ofinter-frame homographies.

Problem Formulation

For the projective camera, a pinhole model, parameterized by a cameraintrinsic matrix Kε□^(3×3) with five unknowns, may be used. The fiveunknowns are: the focal length along the x and y axes (f_(x) and f_(y)),a skew parameter θ, and coordinates of the principle point (o_(x),o_(p)). The model may be described in matrix form as:

$\begin{matrix}{{K\; {\bullet \begin{bmatrix}f_{x} & \theta & o_{x} \\0 & f_{y} & o_{y} \\0 & 0 & 1\end{bmatrix}}} \in {\bullet^{3 \times 3}.}} & ( {B\; 1} )\end{matrix}$

Without loss of generality, the world coordinate frame may be chosen tobe the camera frame of the first camera, and R_(i)εSO(3) and t_(i)ε□³may be used to denote the Euclidean transformation from the worldcoordinate frame to the i-th camera frame. Note that, by definition,[R₁, t₁]=[I, 0].

It may also be assumed that the world plane π has coordinates π=(n,d)^(T) with respect to the world coordinate frame, where n^(T) is theunit normal vector and d>0 denotes the distance from the plane to theworld origin. Therefore, n^(T)X=d for any point X on the plane.

Given N views of a planar scene {F}_(i=1) ^(N), suppose the planehomography between the first frame F₁ and a frame F_(i) has beenrecovered. The plane homography may be denoted as H_(i), for 1≦i≦N.H_(i) can be expressed in terms of the camera parameters:

H _(i) □K _(i)(R _(i) +t _(i) n ^(T) /d)K ₁ ⁻¹,  (B2)

with the symbol ␣ meaning “equality up to a scale.”

Since the translation parameters can only be recovered up to someunknown scale factor {tilde over (t)}_(i)=t_(i)/d, a goal of theplane-based self-calibration method can be stated as finding all theunknown camera parameters K_(i),R_(i),{tilde over (t)} (the cameraintrinsic parameters, rotation, and translation for each frame) and theplane normal n from the given inter-frame homographies {H_(i)}_(i=1)^(N). The plane-based self-calibration methods described below mayrecover the camera motion and structure parameters from inter-framehomographies generated for planar or near-planar scenes, for example aset of inter-frame homographies generated according to an embodiment ofone of the techniques described in the above section titled Robust planedetection and tracking techniques.

The Plane-Based Self-Calibration Methods

Although an explicit 3D reconstruction cannot be calculated from asingle scene plane, self-calibration is possible. More precisely, ifthere are a total number of m unknowns in the camera intrinsicparameters of all N views, then a solution is possible provided 2N≧m+4.

In practice, additional restrictions on the camera intrinsics may beavailable, which may provide additional algebraic constraints. Forexample, for most modern digital cameras, zero skew (θ=0) and unitaspect ratio (f_(x)=f_(y)) may be assumed. It may also be assumed thatthe principal point coincides with the image center, as the errorintroduced with this approximation is normally well within the region ofconvergence of the subsequent nonlinear optimization. As a result, theself-calibration problem may be reduced to simply searching for thefocal lengths {f_(i)}_(i=1) ^(N) for all the frames. Two cases arediscussed: self-calibration with constant focal length, andself-calibration with varying focal lengths. FIGS. 7 and 8 broadlyillustrate these two methods.

FIG. 7 broadly illustrates a plane-based self-calibration method withconstant focal length that takes as input a set of homographies andoutputs structure and camera parameters, according to at least someembodiments. As indicated at 700, a set of inter-image homographies maybe obtained, for example as output by one of the plane detection andtracking algorithms (algorithms 1 and 2) as described above. Asindicated at 702, for each guess of a focal length, the plane normal maybe computed, and camera parameters may be estimated. As indicated at704, each focal length may then be scored based on how well therecovered structure and camera parameters fit the homographies. Asindicated at 706, the structure, camera parameters, and motioncorresponding to a best score may be output.

FIG. 8 broadly illustrates a plane-based self-calibration method withvarying focal length that takes as input a set of homographies andoutputs structure and camera parameters, according to at least someembodiments. A set of inter-image homographies may be obtained for animage sequence. As indicated at 800, the method of FIG. 7 may be appliedto multiple small segments of the image sequence. As indicated at 802,the resulting focal lengths may then be refined. As indicated at 804,the structure, camera parameters, and motion corresponding to a bestscore may be output.

The methods of FIGS. 7 and 8 and variations thereof are described inmore detail below.

Self-Calibration with Constant Focal Length

In many real scenarios, the focal length of the camera remains constantover the entire sequence. When this is the case, K₁=K₂= . . . =K_(N)□Kand equation (B2) becomes:

H _(i) □K(R _(i) +{tilde over (t)} _(i) n ^(T))K ⁻¹  (B3)

The plane-based self-calibration method may be based on twoobservations. First, if the focal length f (or equivalently the matrixK) is given, then there are at most two physically possible solutionsfor a decomposition of any H into parameters {R,{tilde over (t)},n}.Furthermore, the space of possible values of f is inherently bounded bythe finiteness of the acquisition devices. In this discussion, thefollowing is assumed: fε[0.3f₀, 3f₀] where f₀ is some nominal valuedefined as the sum of half width and half height of the image.

In at least some embodiments, the following general method may beimplemented:

-   1. Given each guess on f, compute the plane normal n from the    homography induced by any two images. This yields at most two    physically possible n's. For each n, estimate all the camera    parameters {R_(i),{tilde over (t)}_(i)}_(i=2) ^(N) and refine the    estimates via a non-linear least squares technique.-   2. Enumerate the space of focal lengths (a subset of □) and score    each focal length f based on how well the recovered structure and    camera parameters fit the homographies.-   3. Select a best solution according to the scores.

Each of the steps in the above method is discussed in more detail below.

Planar Homography Decomposition

Embodiments may employ a technique for decomposing a homography matrixinto structure and camera parameters, which may be referred to as aplanar homography decomposition method. Note that in the Euclideanframe, a homography matrix H may be written in the form:

H=λ(R+{tilde over (t)}n ^(T))  (B4)

for some scale factor λ. The plane homography decomposition method maycompute λ using the fact that |λ| is equal to the second largestsingular value of H:

|λ|=σ₂(H).  (B5)

The sign of λ may be determined by imposing the positive depthconstraint x₂ ^(T)Hx₁>0 for any point correspondence (x₁, x₂) betweenthe two images.

Now let {tilde over (H)}=H/λ=R+{tilde over (t)}n^(T). {tilde over(H)}^(T){tilde over (H)} may be diagonalized into the form:

{tilde over (H)} ^(T) {tilde over (H)}=VΣV ^(T),  (B6)

where Σ=diag{σ₁ ²,σ₂ ²,σ₃ ²} and V=[v₁,v₂,v₃]εSO(3). By definingvectors:

$\begin{matrix}{{u_{1}\bullet \frac{{\sqrt{1 - \sigma_{3}^{2}}v_{1}} + {\sqrt{\sigma_{1}^{2} - 1}v_{3}}}{\sqrt{\sigma_{1}^{2} - \sigma_{3}^{2}}}},{u_{2}\bullet \frac{{\sqrt{1 - \sigma_{3}^{2}}v_{1}} + {\sqrt{\sigma_{1}^{2} - 1}v_{3}}}{\sqrt{\sigma_{1}^{2} - \sigma_{3}^{2}}}},} & ( {B\; 7} )\end{matrix}$

it is possible to verify that H preserves the length of any vectorsinside each of the two subspaces:

S ₁=span{v ₂ ,u ₁ }, S ₂ =span{v ₂ ,u ₂}.  (B8)

Let matrices:

U ₁ =[v ₂ ,u ₁,

u ₁ ], W ₁ =[Hv ₂ ,Hu ₁ ,

v ₂ Hu ₁],

U ₂ =[v ₂ ,u ₁,

u ₂ ], W ₂ =[Hv ₂ ,Hu ₁ ,

v ₂ Hu ₂],

then there are:

RU ₁ =W ₁ , RU ₂ =W ₂,  (B9)

from which R can be determined. The four solutions for decomposing{tilde over (H)} to {R,{tilde over (t)},n} (i.e., the four solutions tothe planar homography decomposition) are given in Table 1, shown in FIG.9. The positive depth constraint can be imposed to reduce the number ofphysically possible solutions to at most two: n^(T)e₃=n₃>0.

Also of interest is the related problem of decomposing anotherhomography H′ into {R′,{tilde over (t)}′} using the plane normal ncomputed from H. Here U₁,U₂ remain unchanged and W₁′,W₂′ may be definedas

W ₁ ′[H′v ₂ ,H′u ₁ ,

′v ₂ H′u ₁ ], W ₂ ′=[H′v ₂ ,H′u ₂

′v ₂ H′u ₂]  (B10)

Note that if the two planes inducing H and H′ have the same normalvector, there must exist some R′εSO(3) such that:

R′U ₁ =W ₁ ′, R′U ₂ =W ₂′  (B11)

However, when the above assumption does not hold, the best R′ in theleast squares sense may still be found. Taking the equation R′U₁=W₁′ asan example, the following may be solved:

$\begin{matrix}{{\min\limits_{R^{\prime} \in {{SO}{(3)}}}{{W_{1}^{\prime} - {R^{\prime}U_{1}}}}_{F}},} & ({B12})\end{matrix}$

which has a closed-form solution:

R′=U′V′ ^(T)  (B13)

where W₁′U₁ ^(T)=U′Σ′V′^(T) is the singular value decomposition of W₁′U₁^(T). Finally, {tilde over (t)}′ is given by

{tilde over (t)}′=(H′−R′)n.  (B14)

Estimation of the Focal Length

As previously mentioned, embodiments of the plane-based self-calibrationalgorithm may determine the focal length f by enumerating all of itspossible values and checking how well the resulting camera parameters{R_(i),{tilde over (t)}_(i)}_(i=2) ^(N) and plane normal n fit thehomography matrices { H _(i)}_(i=2) ^(N) where H _(i)=K⁻¹H_(i)K.Mathematically, a task is to minimize the following objective function:

$\begin{matrix}{{\min\limits_{\lambda_{i},R_{i},{\overset{\sim}{t}}_{i},n}C_{1}} = {\sum\limits_{i = 2}^{N}{w_{i}{{{{\overset{\_}{H}}_{i}/\lambda_{i}} - ( {R_{i} + {{\overset{\sim}{t}}_{i}n^{T}}} )}}_{F}^{2}}}} & ({B15})\end{matrix}$

where w_(i) is a weight which is set to be the number of inlyingtrajectories used to estimate H_(i). This non-linear optimizationproblem can be solved, for example, via the Levenberg-Marquardt (LM)method. To obtain an initial estimate of all parameters, at least someembodiments may use a three-stage scheme. First, all the λ_(i)'s may beestimated using equation (B5). Then, one homography may be picked, and nmay be computed according to Table 1. Finally, for each of the twophysically possible n's, [R_(i),{tilde over (t)}_(i)}_(i=2) ^(N) may becomputed using equations (B13) and (B14).

The computational complexity of this method is linear in the number ofsamples of f. More importantly, note that in equation (B15) only theplane normal n is shared by all the homographies. Therefore, in at leastsome embodiments, a sparse LM algorithm may be implemented to solveequation (B15) efficiently.

Choosing the Homography Used for Computing n

Note that in the extreme case when the translation component t_(i) iszero, it may be impossible to recover n from H_(i) according to equation(B2). Moreover, in practice the recovered homographies may be subject tosome small errors. Therefore, a large t_(i) may be used in at least someembodiments, as a large t_(i) may yield a more stable estimate of n ifall the H_(i)'s are of roughly the same noise level. Consequently, atleast some embodiments may always choose a homography H_(N) between thefirst and last frames for estimating n.

Scoring the Reconstructions

There are several ways to score the Euclidian reconstructions estimatedat each sampled focal length f. For example, a fitting error C₁ may becompared to several other cost functions. One example cost functioncompares the normalized difference of the two non-zero singular valuesσ_(i) ¹ and σ_(i) ² (σ_(i) ¹≧σ_(i) ²) of the matrix H _(i){circumflexover (n)}:

$\begin{matrix}{C_{2} = {\sum\limits_{i = 2}^{N}{\frac{\sigma_{i}^{1} - \sigma_{i}^{2}}{\sigma_{i}^{1}}.}}} & ({B16})\end{matrix}$

Instead or in addition, the closeness of the two singular values may bemeasured, for example using log-anisotropy:

$\begin{matrix}{C_{2}^{\prime} = {\sum\limits_{i = 2}^{N}{\log {\frac{\sigma_{i}^{1}}{\sigma_{i}^{2}}.}}}} & ({B17})\end{matrix}$

Another cost function that may be used instead of or in addition to theabove may be derived based on a statistical error measurement:

$C_{3} = {\sum\limits_{i = 2}^{N}\begin{Bmatrix}{\frac{( {{a_{i}}^{2} - {b_{i}}^{2}} )/4}{{{x}^{2}{{K^{- T}a_{i}}}^{2}} + {{y}^{2}{{K^{- T}b_{i}}}^{2}} + {2( {a_{i}^{T}K^{- 1}K^{- T}b_{i}} )( {x^{T}y} )}} +} \\\frac{( {a_{i}^{T}b_{i}} )^{2}}{{{x}^{2}{{K^{- T}b_{i}}}^{2}} + {{y}^{2}{{K^{- T}b_{i}}}^{2}} + {2( {a_{i}^{T}K^{- 1}K^{- T}b_{i}} )( {x^{T}y} )}}\end{Bmatrix}}$

where (x, y)=K(v₂,u₁) for S1 or (x, y)=K(v₂,u₂) for S₂ as defined inequation (B8), and (a_(i), b_(i))=K⁻¹H_(i)K(x, y).

Constant Focal Length Self-Calibration Algorithm

An example of the self-calibration algorithm according to at least someembodiments is given below as algorithm 3. Note that this examplealgorithm is not intended to be limiting.

Algorithm 3 (Self-Calibration with Constant Focal Length)

-   01: Input: A set of N homographies {H_(i)}_(i=1) ^(N).-   02: for each guess on f:-   03: Compute the plane normal n from H_(N). This yields at most two    physically possible n's.-   04: for each n:-   05: Estimate {R_(i), t _(i)}_(i=1) ^(N) using equations (B13),    (B14).-   06: Refine {K_(i), R_(i), {tilde over (t)}_(i)}_(i=1) ^(N) and n via    a non-linear least squares technique.-   07: end for-   08: end for-   09: Select the best f according to the geometric scores.-   10: Output: Plane unit normal n, camera intrinsic matrices    {K_(i)}_(i=1) ^(N) and motion {R_(i), {tilde over (t)}_(i)}_(i=1)    ^(N).

FIG. 10 is a more detailed flowchart of the self-calibration method withconstant focal length, according to at least some embodiments. Asindicated at 900, a set of inter-image homographies for a plurality offrames in an image sequence may be obtained. For example, the set ofinter-image homographies may be generated according to an embodiment ofone of the techniques described in the above section titled Robust planedetection and tracking techniques.

To perform self-calibration, the method may solve for a reconstructionat each of a plurality of focal lengths. At each focal length, twosolutions for the plane normal may be found according to two of thehomographies (for example a first and last homography), and used toestimate the reconstruction across all the frames. Thus, there are tworeconstructions estimated at each of the focal lengths. Eachreconstruction is scored, and a reconstruction for the sequence with abest score is selected.

As indicated at 902, a next focal length is selected. As indicated at904, the two solutions for the plane normal at the current focal lengthare found according to the homographies. As indicated at 906, for eachsolution for the plane normal, the camera motion is estimated for eachframe. The camera motion, camera parameters, and the plane normal maythen be refined across all frames, for example according to a non-linearleast squares technique. As indicated at 908, for each solution for theplane normal, a score may be generated that indicates how closely theestimated reconstruction fits the inter-image homographies.

At 910, if there are more focal lengths at which reconstructions are tobe estimated, then the method returns to 902. Otherwise, as indicated at912, a reconstruction with a best score is selected for the imagesequence. The camera motions for each frame, camera intrinsic parametersfor each frame, and plane normal for the sequence are output as theEuclidian reconstruction for the image sequence, as indicated at 914.

Self-Calibration with Varying Focal Length

The self-calibration method described above may be extended to the caseof varying focal length. An observation is that for real worldsequences, focal length tends to not change much over any short periodof time. Therefore, the entire sequence may be divided into many smallsegments of k frames, and the method for constant focal length may beapplied within each segment. Once an initial solution to the homographydecomposition problem has been obtained, the constant-focal-lengthconstraint is dropped, and all the focal lengths may be refined, forexample via nonlinear optimization. In this case, the following problemis of interest:

$\begin{matrix}{{\min\limits_{K_{i},\lambda_{i},R_{i},{\overset{\sim}{t}}_{i},n}C_{v}} = {\sum\limits_{i = 2}^{N}{{{{K_{i}^{- 1}H_{i}{K_{1}/\lambda_{i}}} - ( {R_{i} + {{\overset{\sim}{t}}_{i}n^{T}}} )}}_{F}^{2}.}}} & ({B18})\end{matrix}$

An example algorithm to implement this procedure that may be used insome embodiments is given below as algorithm 4. Note that this examplealgorithm is not intended to be limiting.

Algorithm 4 (Self-Calibration with Varying Focal Length, Version 1)

-   01: Input: A set of N homographies {H_(i)}_(i=1) ^(N). A partition    of the frames into m segments of size k.-   02: for each guess on f-   03: Set {f₁, . . . , f_(k)} of the first segment to f and compute    the plane normal n from H_(k). This yields at most two physically    possible n's.-   04: for each n-   05: Estimate {R_(i), {tilde over (t)}_(i)}_(i=1) ^(k) within the    first segment.-   06: Refine {K_(i), R_(i), {tilde over (t)}_(i)}_(i=1) ^(k) and n via    a non-linear least squares technique.-   07: for 2≦j≦m (for each segment)-   08: Set {f_(k×(j-1)+1), . . . , f_(k×j)} to f_(k×(j-1)) and compute

{R _(i) ,{tilde over (t)} _(i)}_(i=k×(j-1)+1) ^(k×j).

-   09: Refine {K_(i),R_(i), {tilde over (t)}_(i)}_(i=1) ^(k×j) and n    via a non-linear least squares technique.-   10: end for-   11: end for-   12: end for-   13: Keep the best f according to the geometric scores.-   14: Output: Plane unit normal n, camera intrinsic matrices    {K_(i)}_(i=1) ^(N) and motion {R_(i), {tilde over (t)}_(i)}_(i=1)    ^(N).

FIG. 11 is a flowchart of an embodiment of the self-calibration methodfor varying focal lengths according to algorithm 4. As indicated at1000, a set of inter-image homographies for a plurality of frames in animage sequence may be obtained. For example, the set of inter-imagehomographies may be generated according to an embodiment of one of thetechniques described in the above section titled Robust plane detectionand tracking techniques. The image sequence is partitioned into aplurality of segments.

To perform self-calibration, the method may solve for a reconstructionat each of a plurality of focal lengths. At each focal length, twosolutions for the plane normal may be found for a first segment. Foreach solution to the plane normal, a reconstruction is estimated for thefirst segment and extrapolated across all the segments. Thus, there aretwo reconstructions for the sequence estimated at each of the focallengths. Each reconstruction is scored, and a reconstruction for thesequence with a best score is selected.

As indicated at 1002, a next focal length is obtained. As indicated at1004, the focal length for the first segment is set to the focal lengthand the two solutions for the plane normal for the first segment arecomputed according to a homography for the first segment. As indicatedat 1006, the camera motion is estimated for the first segment accordingto the current solution for the plane normal, and the camera motion,camera parameters, and the plane normal for the first segment are thenrefined, for example according to a non-linear least squares technique.As indicated at 1008, for each subsequent segment, the focal length isto the focal length at the end of the previous segment, the cameramotion is computed, and the camera motion, camera parameters, and planenormal are refined. As indicated at 1010, a score is generated thatindicates how well the estimated reconstruction fits the set ofhomographies for the image sequence.

At 1012, if there is another plane normal solution, then the methodreturns to element 1006. Otherwise, at 1014, if there are more focallengths, then the method returns to element 1002. At 1014, once allfocal lengths to be tested have been processed, then a reconstructionwith a best score may be selected for the image sequence, as indicatedat 1016. The camera motions for each frame, camera intrinsic parametersfor each frame, and plane normal for the sequence are output as theEuclidian reconstruction for the image sequence.

The above self-calibration method (algorithm 4) has the same searchcomplexity as the constant focal length case, but requires solving anon-linear optimization problem multiple times. A potential drawback ofthis approach is that the initial estimate of n in step 1 may not bevery accurate as only the first k frames are used (small translationcomponent) and the focal length is only approximately constant. As analternative, in some embodiments, all possible values of (f₁, f_(n))ε□²may be sampled, and for each sample point n may be computed using H_(N)between the first and last frames. Then, f_(i), i=2, . . . N−1 may beestimated using the following equation:

∥K _(i) ⁻¹ H _(i) K ₁ v ₂∥² =∥K _(i) ⁻¹ H _(i) K ₁ u ₁∥² or ∥K _(i) ⁻¹ H_(i) K ₁ v ₂∥² =∥K _(i) ⁻¹ H _(i) K ₁ u ₂∥²,  (B19)

depending on the choice of n from the two physically possible solutions.

This procedure may yield a better initial estimation of n at the cost ofa larger search space. An example algorithm to implement this procedurethat may be used in some embodiments is given below as algorithm 5. Notethat this example algorithm is not intended to be limiting.

Algorithm 5 (Self-Calibration with Varying Focal Length, Version 2)

-   01: Input: A set of N {H_(i)}_(i=1) ^(N).-   02: for each guess on f₁ and f_(N):-   03: Compute the plane normal n from H_(N). This yields at most two    physically possible n's.-   04: for each n-   05: Estimate {K_(i)}_(i=2) ^(N-1) using equation (B19).-   06: Estimate {R_(i), {tilde over (t)}_(i)}_(i=1) ^(N) using    equations (B13), (B14).-   07: Refine {K_(i), R_(i), {tilde over (t)}_(i)}_(i=1) ^(N) and n via    a non-linear least squares technique.-   08: end for-   09: end for-   10: Keep the best (f₁,f_(N)) according to the geometric scores.-   11: Output: Plane unit normal n, camera intrinsic matrices    {K_(i)}_(i=1) ^(N) and motion {R_(i), {tilde over (t)}_(i)}_(i=1)    ^(N).

FIG. 12 is a flowchart of an embodiment of the self-calibration methodfor varying focal lengths according to algorithm 5. As indicated at1100, a set of inter-image homographies for a plurality of frames in animage sequence may be obtained. For example, the set of inter-imagehomographies may be generated according to an embodiment of one of thetechniques described in the above section titled Robust plane detectionand tracking techniques.

To perform self-calibration, the method may solve for a reconstructionat each of a plurality of guesses at focal lengths for two frames (e.g.,a first and last frame in the image sequence). At each pair of focallengths, two solutions for the plane normal may be found for the imagesequence. For each solution to the plane normal, the focal length isestimated across the frames. Camera motion (rotation and translation) isestimated across the frames according to the focal lengths. The cameraintrinsic parameters (e.g., focal length), camera motion, and planenormal are then refined. Thus, there are two reconstructions for thesequence estimated at each pair of focal lengths. Each reconstruction isscored, and a reconstruction for the sequence with a best score isselected.

As indicated at 1102, a next guess for a focal length at a first and alast frame may be obtained. This gives two focal lengths, one for thefirst frame and one for the last frame. Note that the guesses may bemade at other frames in the image sequence in some embodiments. Asindicated at 1104, the two solutions for the plane normal for the imagesequence are computed according to a homography for the image sequence.As indicated at 1106, the focal length at the other frames may then beestimated, for example according to equation (B19). As indicated at1108, the camera motion is estimated for the first segment according tothe current solution for the plane normal, for example according toequations (B13) and (B14). As indicated at 1110, the camera motion,camera parameters, and the plane normal are then refined, for exampleaccording to a non-linear least squares technique. As indicated at 1112,a score is generated that indicates how well the estimatedreconstruction fits the set of homographies for the image sequence.

At 1114, if there is another plane normal solution, then the methodreturns to element 1106. Otherwise, at 1116, if there are more focallengths, then the method returns to element 1002. At 1116, once allfocal length pairs to be tested have been processed, then areconstruction with a best score may be selected for the image sequence,as indicated at 1118. The camera motions for each frame, cameraintrinsic parameters for each frame, and plane normal for the sequenceare output as the Euclidian reconstruction for the image sequence.

Example Implementations

Some embodiments may include a means for generating a set of inter-imagehomographies from a set of point trajectories according to a planedetection and tracking technique, and/or for generating structure andmotion for a set of images or frames based on a set of receivedhomographies according to plane-based self-calibration technique. Forexample, a plane detection and tracking module may receive inputspecifying a set of point trajectories and generate as output a set ofhomographies as described herein, and a plane-based self-calibrationmodule may receive as input a set of homographies and generate as outputstructure and motion for a set of images or frames as described herein.In some embodiments, a single module may incorporate both the planedetection and tracking technique and the plane-based self-calibrationtechnique as described herein to take as input a set of trajectories andprovide as output structure and motion for a set of images or frames.These modules may in some embodiments be implemented by anon-transitory, computer-readable storage medium and one or moreprocessors (e.g., CPUs and/or GPUs) of a computing apparatus. Thecomputer-readable storage medium may store program instructionsexecutable by the one or more processors to cause the computingapparatus to perform one or more of the techniques as described herein.Other embodiments of the module(s) may be at least partially implementedby hardware circuitry and/or firmware stored, for example, in anon-volatile memory.

Embodiments of the module(s) may, for example, be implemented asstand-alone applications, as module(s) of an application, as a plug-inor plug-ins for applications including image or video processingapplications, and/or as a library function or functions that may becalled by other applications such as image processing or videoprocessing applications. Embodiments of the module(s) may be implementedin any image or video processing application, or more generally in anyapplication in which video or image sequences may be processed. Exampleapplications in which embodiments may be implemented may include, butare not limited to, Adobe® Premiere® and Adobe® After Effects®. “Adobe,”“Adobe Premiere,” and “Adobe After Effects” are either registeredtrademarks or trademarks of Adobe Systems Incorporated in the UnitedStates and/or other countries. Example modules that may implement theplane-based SFM techniques as described herein are illustrated in FIGS.13, 14, and 15. An example computer system on which the module(s) may beimplemented is illustrated in FIG. 16. Note that one or more of themodules may, for example, be implemented in still cameras and/or videocameras.

FIG. 13 illustrates an example plane detection and tracking module thatmay implement one or more of the plane detection and tracking techniquesillustrated in the accompanying Figures and described herein, forexample as algorithms 1 or 2, or any of FIGS. 3 through 6, according toat least some embodiments. Module 1600 may, for example, receive aninput image sequence 1620 and/or a set of point trajectories for theimages in a sequence. Module 1600 then applies one or more of the planedetection and tracking techniques as described herein to generatehomographies from the trajectories by detecting plane(s) in the images1620, identifying trajectories that track plane(s) through the images,and using the identified trajectories to generate inter-imagehomographies. Module 1600 generates as output at least a set ofhomographies 1630 for the images, as described herein.

FIG. 14 illustrates an example plane-based self-calibration module thatmay implement one or more of the plane-based self-calibration techniquesillustrated in the accompanying Figures and described herein, forexample as algorithms 3, 4 and 5 or FIGS. 7, 8, 10, 11, and 12 accordingto at least some embodiments. Module 1700 may, for example, receive aninput a set of homographies 1730 corresponding to a set of images. Theset of homographies 1730 may, for example, be the output of module 1600as illustrated in FIG. 13. Module 1700 then applies one or more of theplane-based self-calibration techniques as described herein to thehomographies 1730 to generate structure, camera parameters, and motionaccording to a best score for focal lengths that were tested. Module1700 generates as output at least the structure, camera parameters, andmotion, as described herein as camera motion and other parameters 1740.

While FIGS. 13 and 14 show the plane detection and tracking method andthe plane-based self-calibration method implemented as separate modules,note that embodiments of the plane detection and tracking method and ofthe plane-based self-calibration method described herein may beimplemented in a single module that receives point trajectories for aset of images and outputs the structure, camera parameters, and motionfor the set of images, as shown in FIG. 15. FIG. 15 illustrates anexample SFM module that implements embodiments of a plane detection andtracking method and of a plane-based self-calibration method asdescribed herein. Module 1900 may, for example, receive an input imagesequence 1920 and/or a set of point trajectories for the images in asequence. Module 1900 then applies a plane detection and tracking 1902technique as described herein to generate homographies from thetrajectories by detecting plane(s) in the images 1920, identifyingtrajectories that track plane(s) through the images, and using theidentified trajectories to generate inter-image homographies. Planedetection and tracking 1902 generates at least a set of homographies1930 for the images. A plane-based self-calibration 1904 technique is tothe homographies 1930 to generate structure, camera parameters, andmotion according to a best score for focal lengths that were tested.Output of module 1900 is at least the camera motion and other parameters1940 as generated by the plane-based self-calibration 1904 technique.

Example Applications

Example applications of the plane-based SFM techniques including theplane detection and tracking techniques and the plane-basedself-calibration techniques as described herein may include one or moreof, but are not limited to, 3D modeling, video stabilization, videoaugmentation (augmenting an original video sequence with graphicobjects), video classification, and robot navigation. In general,embodiments of one or more of the techniques may be used to providehomographies and/or structure and motion to any application thatrequires or desires such output to perform some video- orimage-processing task.

Example System

Embodiments of the various plane-based SFM techniques as describedherein, including the plane detection and tracking method for generatinghomographies for a set of images and the plane-based self-calibrationtechniques for generating structure, camera parameters, and motion fromsets of homographies, may be executed on one or more computer systems,which may interact with various other devices. One such computer systemis illustrated by FIG. 16. In different embodiments, computer system2000 may be any of various types of devices, including, but not limitedto, a personal computer system, desktop computer, laptop, notebook, ornetbook computer, mainframe computer system, handheld computer,workstation, network computer, a camera, a video camera, a tablet or paddevice, a smart phone, a set top box, a mobile device, a consumerdevice, video game console, handheld video game device, applicationserver, storage device, a peripheral device such as a switch, modem,router, or in general any type of computing or electronic device.

In the illustrated embodiment, computer system 2000 includes one or moreprocessors 2010 coupled to a system memory 2020 via an input/output(I/O) interface 2030. Computer system 2000 further includes a networkinterface 2040 coupled to I/O interface 2030, and one or moreinput/output devices 2050, such as cursor control device 2060, keyboard2070, display(s) 2080, and touch- or multitouch-enabled device(s) 2090.In some embodiments, it is contemplated that embodiments may beimplemented using a single instance of computer system 2000, while inother embodiments multiple such systems, or multiple nodes making upcomputer system 2000, may be configured to host different portions orinstances of embodiments. For example, in one embodiment some elementsmay be implemented via one or more nodes of computer system 2000 thatare distinct from those nodes implementing other elements.

In various embodiments, computer system 2000 may be a uniprocessorsystem including one processor 2010, or a multiprocessor systemincluding several processors 2010 (e.g., two, four, eight, or anothersuitable number). Processors 2010 may be any suitable processor capableof executing instructions. For example, in various embodiments,processors 2010 may be general-purpose or embedded processorsimplementing any of a variety of instruction set architectures (ISAs),such as the x86, PowerPC, SPARC, or MIPS ISAs, or any other suitableISA. In multiprocessor systems, each of processors 2010 may commonly,but not necessarily, be implement the same ISA.

In some embodiments, at least one processor 2010 may be a graphicsprocessing unit. A graphics processing unit or GPU may be considered adedicated graphics-rendering device for a personal computer,workstation, game console or other computing or electronic device.Modern GPUs may be very efficient at manipulating and displayingcomputer graphics, and their highly parallel structure may make themmore effective than typical CPUs for a range of complex graphicalalgorithms. For example, a graphics processor may implement a number ofgraphics primitive operations in a way that makes executing them muchfaster than drawing directly to the screen with a host centralprocessing unit (CPU). In various embodiments, the plane-based SFMtechniques described herein may, at least in part, be implemented byprogram instructions configured for execution on one of, or parallelexecution on two or more of, such GPUs. The GPU(s) may implement one ormore application programmer interfaces (APIs) that permit programmers toinvoke the functionality of the GPU(s). Suitable GPUs may becommercially available from vendors such as NVIDIA Corporation, ATITechnologies (AMD), and others.

System memory 2020 may be configured to store program instructionsand/or data accessible by processor 2010. In various embodiments, systemmemory 2020 may be implemented using any suitable memory technology,such as static random access memory (SRAM), synchronous dynamic RAM(SDRAM), nonvolatile/Flash-type memory, or any other type of memory. Inthe illustrated embodiment, program instructions and data implementingdesired functions, such as those described above for embodiments of thevarious plane-based SFM techniques are shown stored within system memory2020 as program instructions 2025 and data storage 2035, respectively.In other embodiments, program instructions and/or data may be received,sent or stored upon different types of computer-accessible media or onsimilar media separate from system memory 2020 or computer system 2000.Generally speaking, a computer-accessible medium may include storagemedia or memory media such as magnetic or optical media, e.g., disk orCD/DVD-ROM coupled to computer system 2000 via I/O interface 2030.Program instructions and data stored via a computer-accessible mediummay be transmitted by transmission media or signals such as electrical,electromagnetic, or digital signals, which may be conveyed via acommunication medium such as a network and/or a wireless link, such asmay be implemented via network interface 2040.

In one embodiment, I/O interface 2030 may be configured to coordinateI/O traffic between processor(s) 2010, system memory 2020, and anyperipheral devices in the device, including network interface 2040 orother peripheral interfaces, such as input/output devices 2050. In someembodiments, I/O interface 2030 may perform any necessary protocol,timing or other data transformations to convert data signals from onecomponent (e.g., system memory 2020) into a format suitable for use byanother component (e.g., processor(s) 2010). In some embodiments, I/Ointerface 2030 may include support for devices attached through varioustypes of peripheral buses, such as a variant of the Peripheral ComponentInterconnect (PCI) bus standard or the Universal Serial Bus (USB)standard, for example. In some embodiments, the function of I/Ointerface 2030 may be split into two or more separate components, suchas a north bridge and a south bridge, for example. In addition, in someembodiments some or all of the functionality of I/O interface 2030, suchas an interface to system memory 2020, may be incorporated directly intoprocessor(s) 2010.

Network interface 2040 may be configured to allow data to be exchangedbetween computer system 2000 and other devices attached to a network,such as other computer systems, or between nodes of computer system2000. In various embodiments, network interface 2040 may supportcommunication via wired or wireless general data networks, such as anysuitable type of Ethernet network, for example; viatelecommunications/telephony networks such as analog voice networks ordigital fiber communications networks; via storage area networks such asFibre Channel SANs, or via any other suitable type of network and/orprotocol.

Input/output devices 2050 may, in some embodiments, include one or moredisplay terminals, keyboards, keypads, touchpads, scanning devices,voice or optical recognition devices, or any other devices suitable forentering or retrieving data by one or more computer system 2000.Multiple input/output devices 2050 may be present in computer system2000 or may be distributed on various nodes of computer system 2000. Insome embodiments, similar input/output devices may be separate fromcomputer system 2000 and may interact with one or more nodes of computersystem 2000 through a wired or wireless connection, such as over networkinterface 2040.

As shown in FIG. 16, memory 2020 may include program instructions 2025,configured to implement embodiments of the various plane-based SFMtechniques as described herein, and data storage 2035, comprisingvarious data accessible by program instructions 2025. In one embodiment,program instructions 2025 may include software elements of embodimentsof the various plane-based SFM techniques as illustrated in the aboveFigures. Data storage 2035 may include data that may be used inembodiments. In other embodiments, other or different software elementsand data may be included.

Those skilled in the art will appreciate that computer system 2000 ismerely illustrative and is not intended to limit the scope of thevarious plane-based SFM techniques as described herein. In particular,the computer system and devices may include any combination of hardwareor software that can perform the indicated functions, including acomputer, personal computer system, desktop computer, laptop, notebook,or netbook computer, mainframe computer system, handheld computer,workstation, network computer, a camera, a video camera, a set top box,a mobile device, network device, internet appliance, PDA, wirelessphones, pagers, a consumer device, video game console, handheld videogame device, application server, storage device, a peripheral devicesuch as a switch, modem, router, or in general any type of computing orelectronic device. Computer system 2000 may also be connected to otherdevices that are not illustrated, or instead may operate as astand-alone system. In addition, the functionality provided by theillustrated components may in some embodiments be combined in fewercomponents or distributed in additional components. Similarly, in someembodiments, the functionality of some of the illustrated components maynot be provided and/or other additional functionality may be available.

Those skilled in the art will also appreciate that, while various itemsare illustrated as being stored in memory or on storage while beingused, these items or portions of them may be transferred between memoryand other storage devices for purposes of memory management and dataintegrity. Alternatively, in other embodiments some or all of thesoftware components may execute in memory on another device andcommunicate with the illustrated computer system via inter-computercommunication. Some or all of the system components or data structuresmay also be stored (e.g., as instructions or structured data) on acomputer-accessible medium or a portable article to be read by anappropriate drive, various examples of which are described above. Insome embodiments, instructions stored on a computer-accessible mediumseparate from computer system 2000 may be transmitted to computer system2000 via transmission media or signals such as electrical,electromagnetic, or digital signals, conveyed via a communication mediumsuch as a network and/or a wireless link. Various embodiments mayfurther include receiving, sending or storing instructions and/or dataimplemented in accordance with the foregoing description upon acomputer-accessible medium. Accordingly, the present invention may bepracticed with other computer system configurations.

CONCLUSION

Various embodiments may further include receiving, sending or storinginstructions and/or data implemented in accordance with the foregoingdescription upon a computer-accessible medium. Generally speaking, acomputer-accessible medium may include storage media or memory mediasuch as magnetic or optical media, e.g., disk or DVD/CD-ROM, volatile ornon-volatile media such as RAM (e.g. SDRAM, DDR, RDRAM, SRAM, etc.),ROM, etc., as well as transmission media or signals such as electrical,electromagnetic, or digital signals, conveyed via a communication mediumsuch as network and/or a wireless link.

The various methods as illustrated in the Figures and described hereinrepresent example embodiments of methods. The methods may be implementedin software, hardware, or a combination thereof. The order of method maybe changed, and various elements may be added, reordered, combined,omitted, modified, etc.

Various modifications and changes may be made as would be obvious to aperson skilled in the art having the benefit of this disclosure. It isintended that the invention embrace all such modifications and changesand, accordingly, the above description to be regarded in anillustrative rather than a restrictive sense.

1. A method, comprising: generating, by one or more computing devices, aEuclidian reconstruction for an image sequence comprising a plurality offrames according to a set of inter-image homographies for the imagesequence, wherein each inter-image homography represents a projectivetransformation from one image in the sequence to another image in thesequence, wherein said generating comprises: estimating at least oneEuclidian reconstruction at each of two or more focal lengths accordingto the set of inter-image homographies, wherein each Euclidianreconstruction comprises camera motion and camera intrinsic parametersat each frame of the image sequence and a plane normal for the imagesequence; and selecting one of the Euclidian reconstructions that bestfits the set of inter-image homographies as the Euclidian reconstructionfor the image sequence.
 2. The method as recited in claim 1, wherein thecamera motion includes rotation and translation, and wherein the cameraintrinsic parameters include focal length.
 3. The method as recited inclaim 1, wherein said estimating at least one Euclidian reconstructionat each of the two or more focal lengths according to the set ofinter-image homographies comprises, for each of the two or more focallengths: solving for a plane normal at the focal length according to theset of inter-image homographies, wherein said solving generates twosolutions for the plane normal; and estimating a Euclidianreconstruction for each solution to the plane normal at the focallength.
 4. The method as recited in claim 3, wherein said estimating aEuclidian reconstruction for each solution to the plane normal at thefocal length comprises, for each solution for the plane normal:estimating camera motion for the frames according to the solution forthe plane normal and the focal length; refining the estimated cameramotion, the focal length, and the plane normal across all the frames togenerate a Euclidian reconstruction for the solution for the planenormal at the focal length; and calculating a score for the Euclidianreconstruction according to how well the reconstruction fits the set ofinter-image homographies.
 5. The method as recited in claim 4, whereinsaid refining is performed according to a non-linear least-squarestechnique.
 6. The method as recited in claim 1, wherein said estimatingat least one Euclidian reconstruction at each of the two or more focallengths according to the set of inter-image homographies comprises:partitioning the image sequence into a plurality of segments eachcomprising at least two consecutive frames; for each of the two or morefocal lengths: solving for a plane normal at the focal length for afirst segment of the image sequence according to the respectiveinter-image homographies, wherein said solving generates two solutionsfor the plane normal at the first segment; estimating a Euclidianreconstruction for each solution for the plane normal at the firstsegment, wherein said estimating comprises: estimating camera motion forthe first segment according to the solution for the plane normal and thefocal length and refining the estimated camera motions, the focallength, and the plane normal for the first segment; for each subsequentsegment, estimating camera motion for the segment according to therefined focal length at the previous segment and refining the estimatedcamera motion, focal length, and plane normal for the segment.
 7. Themethod as recited in claim 1, wherein said estimating at least oneEuclidian reconstruction at each of the two or more focal lengthsaccording to the set of inter-image homographies comprises, for at leasttwo combinations of a focal length at a first frame and a focal lengthat a last frame in the video sequence: solving for a plane normalaccording to the set of inter-image homographies and the combination offocal lengths at the first frame and the last frame, wherein saidsolving generates two solutions for the plane normal; for each solutionfor the plane normal: estimating focal length at each of the framesbetween the first frame and the last frame according to the set ofinter-image homographies; estimating camera motion for the framesaccording to the estimated focal lengths; refining the estimated cameramotion, the focal length, and the plane normal across all the frames togenerate a Euclidian reconstruction for the solution to the planenormal; and calculating a score for the Euclidian reconstructionaccording to how well the reconstruction fits the set of inter-imagehomographies.
 8. A system, comprising: at least one processor; and amemory comprising program instructions, wherein the program instructionsare executable by at least one of the one or more processors to generatea Euclidian reconstruction for an image sequence comprising a pluralityof frames according to a set of inter-image homographies for the imagesequence, wherein each inter-image homography represents a projectivetransformation from one image in the sequence to another image in thesequence, wherein to generate the Euclidian reconstruction for the imagesequence, the program instructions are executable by the at least oneprocessor to: estimate at least one Euclidian reconstruction at each oftwo or more focal lengths according to the set of inter-imagehomographies, wherein each Euclidian reconstruction comprises cameramotion and camera intrinsic parameters at each frame of the imagesequence and a plane normal for the image sequence; and select one ofthe Euclidian reconstructions that best fits the set of inter-imagehomographies as the Euclidian reconstruction for the image sequence. 9.The system as recited in claim 8, wherein the camera motion includesrotation and translation, and wherein the camera intrinsic parametersinclude focal length.
 10. The system as recited in claim 8, wherein, toestimate at least one Euclidian reconstruction at each of the two ormore focal lengths according to the set of inter-image homographies, theprogram instructions are executable by the at least one processor to,for each of the two or more focal lengths: solve for a plane normal atthe focal length according to the set of inter-image homographies,wherein said solving generates two solutions for the plane normal; andestimate a Euclidian reconstruction for each solution to the planenormal at the focal length.
 11. The system as recited in claim 10,wherein, to estimate a Euclidian reconstruction for each solution to theplane normal at the focal length, the program instructions areexecutable by the at least one processor to, for each solution for theplane normal: estimate camera motion for the frames according to thesolution for the plane normal and the focal length; refine the estimatedcamera motion, the focal length, and the plane normal across all theframes to generate a Euclidian reconstruction for the solution for theplane normal at the focal length; and calculate a score for theEuclidian reconstruction according to how well the reconstruction fitsthe set of inter-image homographies.
 12. The system as recited in claim11, wherein said refining is performed according to a non-linearleast-squares technique.
 13. The system as recited in claim 8, wherein,to estimate at least one Euclidian reconstruction at each of the two ormore focal lengths according to the set of inter-image homographies, theprogram instructions are executable by the at least one processor to:partition the image sequence into a plurality of segments eachcomprising at least two consecutive frames; for each of the two or morefocal lengths: solve for a plane normal at the focal length for a firstsegment of the image sequence according to the respective inter-imagehomographies, wherein said solving generates two solutions for the planenormal at the first segment; and estimate a Euclidian reconstruction foreach solution for the plane normal at the first segment, wherein, toestimate the Euclidian reconstruction for the solution, the programinstructions are executable by the at least one processor to: estimatecamera motion for the first segment according to the solution for theplane normal and the focal length and refining the estimated cameramotions, the focal length, and the plane normal for the first segment;for each subsequent segment, estimate camera motion for the segmentaccording to the refined focal length at the previous segment and refinethe estimated camera motion, focal length, and plane normal for thesegment.
 14. The system as recited in claim 8, wherein, to estimate atleast one Euclidian reconstruction at each of the two or more focallengths according to the set of inter-image homographies, the programinstructions are executable by the at least one processor to, for atleast two combinations of a focal length at a first frame and a focallength at a last frame in the video sequence: solve for a plane normalaccording to the set of inter-image homographies and the combination offocal lengths at the first frame and the last frame, wherein saidsolving generates two solutions for the plane normal; for each solutionfor the plane normal: estimate focal length at each of the framesbetween the first frame and the last frame according to the set ofinter-image homographies; estimate camera motion for the framesaccording to the estimated focal lengths; refining the estimated cameramotion, the focal length, and the plane normal across all the frames togenerate a Euclidian reconstruction for the solution to the planenormal; and calculate a score for the Euclidian reconstruction accordingto how well the reconstruction fits the set of inter-image homographies.15. A non-transitory computer-readable storage medium storing programinstructions, wherein the program instructions are computer-executableto implement: generating a Euclidian reconstruction for an imagesequence comprising a plurality of frames according to a set ofinter-image homographies for the image sequence, wherein eachinter-image homography represents a projective transformation from oneimage in the sequence to another image in the sequence, wherein saidgenerating comprises: estimating at least one Euclidian reconstructionat each of two or more focal lengths according to the set of inter-imagehomographies, wherein each Euclidian reconstruction comprises cameramotion and camera intrinsic parameters at each frame of the imagesequence and a plane normal for the image sequence; and selecting one ofthe Euclidian reconstructions that best fits the set of inter-imagehomographies as the Euclidian reconstruction for the image sequence. 16.The non-transitory computer-readable storage medium as recited in claim15, wherein the camera motion includes rotation and translation, andwherein the camera intrinsic parameters include focal length.
 17. Thenon-transitory computer-readable storage medium as recited in claim 15,wherein, in said estimating at least one Euclidian reconstruction ateach of the two or more focal lengths according to the set ofinter-image homographies, the program instructions arecomputer-executable to implement, for each of the two or more focallengths: solving for a plane normal at the focal length according to theset of inter-image homographies, wherein said solving generates twosolutions for the plane normal; and estimating a Euclidianreconstruction for each solution to the plane normal at the focallength.
 18. The non-transitory computer-readable storage medium asrecited in claim 17, wherein, in said estimating a Euclidianreconstruction for each solution to the plane normal at the focallength, the program instructions are computer-executable to implement,for each solution for the plane normal: estimating camera motion for theframes according to the solution for the plane normal and the focallength; refining the estimated camera motion, the focal length, and theplane normal across all the frames to generate a Euclidianreconstruction for the solution for the plane normal at the focallength; and calculating a score for the Euclidian reconstructionaccording to how well the reconstruction fits the set of inter-imagehomographies.
 19. The non-transitory computer-readable storage medium asrecited in claim 15, wherein, in said estimating at least one Euclidianreconstruction at each of the two or more focal lengths according to theset of inter-image homographies, the program instructions arecomputer-executable to implement: partitioning the image sequence into aplurality of segments each comprising at least two consecutive frames;for each of the two or more focal lengths: solving for a plane normal atthe focal length for a first segment of the image sequence according tothe respective inter-image homographies, wherein said solving generatestwo solutions for the plane normal at the first segment; estimating aEuclidian reconstruction for each solution for the plane normal at thefirst segment, wherein said estimating comprises: estimating cameramotion for the first segment according to the solution for the planenormal and the focal length and refining the estimated camera motions,the focal length, and the plane normal for the first segment; for eachsubsequent segment, estimating camera motion for the segment accordingto the refined focal length at the previous segment and refining theestimated camera motion, focal length, and plane normal for the segment.20. The non-transitory computer-readable storage medium as recited inclaim 15, wherein, in said estimating at least one Euclidianreconstruction at each of the two or more focal lengths according to theset of inter-image homographies, the program instructions arecomputer-executable to implement, for at least two combinations of afocal length at a first frame and a focal length at a last frame in thevideo sequence: solving for a plane normal according to the set ofinter-image homographies and the combination of focal lengths at thefirst frame and the last frame, wherein said solving generates twosolutions for the plane normal; for each solution for the plane normal:estimating focal length at each of the frames between the first frameand the last frame according to the set of inter-image homographies;estimating camera motion for the frames according to the estimated focallengths; refining the estimated camera motion, the focal length, and theplane normal across all the frames to generate a Euclidianreconstruction for the solution to the plane normal; and calculating ascore for the Euclidian reconstruction according to how well thereconstruction fits the set of inter-image homographies.